#!/usr/bin/env python
import argparse
import socket
from pwn import *


def forwardFlag(flag):
    log.warn("Not Implemented")

s  = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
    s.bind(("",12345))
    s.listen(5)
    while True:
        conn, addr = s.accept()
        data = conn.recv(1024)
        log.info("received {}".format(data))
        conn.close()

        forwardFlag(data)

except KeyboardInterrupt:
    print "quit."
    exit(1)
except Exception, e:
    import traceback
    traceback.print_exc()
    print e
    exit(1)
finally:
    s.close()
